Component({
  options: {
    styleIsolation: 'apply-shared'
  },
  properties: {
    value: {
      type: String,
      value: ''
    },
    placeholder: {
      type: String,
      value: ''
    },
    start: {
      type: String,
      value: ''
    },
    end: {
      type: String,
      value: ''
    },
  },
  data: {
    date: ''
  },
  observers: {
    value(date) {
      this.setData({
        date
      })
    }
  },
  lifetimes: {
    attached: function () {
    }
  },
  methods: {
    onChange: function (e) {

      const { detail: { value } } = e;

      this.setData({
        date: value
      });
      this.triggerEvent('change', {
        value
      });
    }
  }
})